checkArgument

open fun checkArgument(expression: Boolean)(source)


open fun checkArgument(expression: Boolean, @NonNull errorMessage: Any)(source)

Ensures that an expression checking an argument is true.

Parameters

expression

the expression to check

errorMessage

the exception message to use if the check fails; will be converted to a string using valueOf

Throws

if expression is false


open fun checkArgument(expression: Boolean, @NonNull messageTemplate: String, @NonNull messageArgs: Array<Any>)(source)

Ensures that an expression checking an argument is true.

Parameters

expression

the expression to check

messageTemplate

a printf-style message template to use if the check fails; will be converted to a string using format

messageArgs

arguments for messageTemplate

Throws

if expression is false